package JavaSE.SETest.No02;

public class CountArray {
    public static void main(String[] args) {
        int[][] list = {{1,-2}, {3,10}, {-4,7,2}, {-5}};
        String pig = "length:8";
        int num = pig.length();
        String dog = "length:" + num;
        System.out.println(dog);
        System.out.println(pig == dog);
        //System.out.println(count(list));
        //count(list);
    }

    public static int count(int[][] list) {
        int length = list.length;
        int[] num = new int[length];
        int result = 0;
        for(int i=0; i<length; i++) {
            for(int j=0; j<list[i].length; j++) {
                //System.out.print(list[i][j] + " ");
                result += list[i][j];
            }
            //System.out.println();
            num[i] = result;
            result = 0;
        }
        for (int i : num) {
            System.out.print(i+" ");
        }
        System.out.println();
        int max = 0;
        int temp = 0;
        for(int i=0; i<num.length-1; i++) {
            for(int j=1; j<num.length; j++) {
                temp = num[i] + num[j];
                if(temp > max) {
                    max = temp;
                }
            }
            temp = 0;
        }
        return max;
    }
}
